import request from '@/utils/request'

// 查询客户类型列表
export function listCustomer(query) {
  return request({
    url: '/project/customer/list',
    method: 'get',
    params: query
  })
}

// 查询客户类型详细
export function getCustomer(cusId) {
  return request({
    url: '/project/customer/' + cusId,
    method: 'get'
  })
}

// 新增客户类型
export function addCustomer(data) {
  return request({
    url: '/project/customer',
    method: 'post',
    data: data
  })
}

// 修改客户类型
export function updateCustomer(data) {
  return request({
    url: '/project/customer',
    method: 'put',
    data: data
  })
}

// 删除客户类型
export function delCustomer(cusId) {
  return request({
    url: '/project/customer/' + cusId,
    method: 'delete'
  })
}

// 导出客户类型
export function exportCustomer(query) {
  return request({
    url: '/project/customer/export',
    method: 'get',
    params: query
  })
}
//修改状态
export function changeCustFlag(cusId,cusFlag){

  const data = {
    cusId,
    cusFlag
  }
  return request({
    url: '/project/customer/changeFlag',
    method: 'put',
    data: data
  })
}

/*查询授权的类别代码*/
export function allocatedLbmList(query) {
  return request({
    url: '/project/customer/authCus/allocatedList',
    method: 'get',
    params: query
  })
}

/*查询未授权的类别代码*/
export function unallocatedLbmList(query) {
  return request({
    url: '/project/customer/authCus/unallocatedList',
    method: 'get',
    params: query
  })
}

/*授权用户操作*/
export function authLbmSelectAll(query) {
  return request({
    url: '/project/customer/authCus/authLbmSelectAll',
    method: 'post',
    params: query
  })
}

/*取消授权类别代码*/
export function authLbmCancel(query) {
  return request({
    url: '/project/customer/authCus/authLbmCancel',
    method: 'delete',
    params: query
  })
}

/*批量取消授权类别代码*/
export function authLbmCancelAll(query) {
  return request({
    url: '/project/customer/authCus/authLbmCancelAll',
    method: 'delete',
    params: query
  })
}

//获取所有有效客户
export function getAllCustomer() {
  return request({
    url: '/project/customer/getAllCustomer',
    method: 'get',
  })
}

//获取所有有效客户(包含所有)
export function getAllCustomerSY() {
  return request({
    url: '/project/customer/getAllCustomerSY',
    method: 'get',
  })
}



//获取所有客户
export function getAllCustomerTwo() {
  return request({
    url: '/project/customer/getAllCustomerTwo',
    method: 'get',
  })
}
